package com.sunny.registry.controller;

import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Sunny
 * @date 2020/2/23
 */
@RestController
public class ZKRegistryController {

    @Resource
    private DiscoveryClient discoveryClient;

    @GetMapping("/services")
    public List<String> getAllServices() {
        return discoveryClient.getServices();
    }
}
